﻿namespace RL
{
    using System;
    using System.Text;

    public class AjaxPlaceHolderEventArgs
    {
        private StringBuilder GeneratedContent = new StringBuilder();

        public AjaxPlaceHolderEventArgs(string content)
        {
            utility.sbAppp(this.GeneratedContent, content);
        }

        public AjaxPlaceHolderEventArgs Add(string code)
        {
            this.GeneratedContent = new StringBuilder(this.GeneratedContent.ToString().Trim() + code.Trim());
            return this;
        }

        public AjaxPlaceHolderEventArgs Add(StringBuilder code)
        {
            this.GeneratedContent = new StringBuilder(this.GeneratedContent.ToString().Trim() + code.ToString().Trim());
            return this;
        }

        public AjaxPlaceHolderEventArgs Add(string code, params string[] parameters)
        {
            this.GeneratedContent = new StringBuilder(this.GeneratedContent.ToString().Trim() + string.Format(code.Trim(), (object[]) parameters));
            return this;
        }

        public override string ToString()
        {
            return this.GeneratedContent.ToString();
        }
    }
}

